<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>imageloader_test.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">imageloader_test.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    <span class='nodesc'>No description.</span>
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_net_imageloader_test.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/net/imageloader_test.js">Git</a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">/goog/net/imageloader_test.js</div>
    </div>
  </div>
<hr/>


   
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="assertImagesAreCorrect"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">assertImagesAreCorrect<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line158">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="handleDisposalImageLoaderEvent"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">handleDisposalImageLoaderEvent<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line97">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="makeLoaderSynchronous&loader.loadImage_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">makeLoaderSynchronous&loader.</span><span class="entryName">loadImage_<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line184">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="makeLoaderSynchronous"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">makeLoaderSynchronous<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Overrides the loader's loadImage_ method so that it dispatches an image
loaded event immediately, causing any event listners to receive them
synchronously.  This allows tests to assume synchronous execution.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line182">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="makeLoaderSynchronous&originalLoadImage"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">makeLoaderSynchronous&originalLoadImage<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line183">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="setUp"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">setUp<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line64">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="tearDown"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">tearDown<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line78">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="testDisposeInTheMiddleOfLoadingWorks"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">testDisposeInTheMiddleOfLoadingWorks<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests loading image and disposing before loading completes.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line86">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="testImagesAddedAfterStart"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">testImagesAddedAfterStart<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Verifies that if an additional image is added after start() was called, but
before COMPLETE was dispatched, no COMPLETE event is sent.  Verifies COMPLETE
is finally sent when .start() is called again and all images have now
completed loading.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line203">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="testImagesAddedAndStartedAfterStart"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">testImagesAddedAndStartedAfterStart<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Verifies that more images can be added after an upload starts, and start()
can be called for them, resulting in just one COMPLETE event once all the
images have completed.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line242">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="testImagesRemovedAfterStart"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">testImagesRemovedAfterStart<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Verifies that if images are removed after loading has started, COMPLETE
is dispatched once the remaining images have finished.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line275">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="testLoadingUntilCompletion"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">testLoadingUntilCompletion<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests loading of images until completion.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line124">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="testSetsCorsAttribute"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">testSetsCorsAttribute<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Verifies that the correct image attribute is set when using CORS requests.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line307">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>






  <h2>Global Variables</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="TEST_EVENT_TYPES"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">TEST_EVENT_TYPES</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line39">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="TEST_IMAGES"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">TEST_IMAGES</span>
        : 
     </div>


     <div class="entryOverview">
       Mapping from test image file name to:
[expected width, expected height, expected event to be fired].

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line50">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="loader"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">loader</span>
        : <span class="type"><a href="class_goog_net_ImageLoader.html">goog.net.ImageLoader</a></span>
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line61">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="startTime"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">startTime</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_net_imageloader_test.js.source.html#line60">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory net</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="" current="/goog/net/imageloader_test.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
